import {createRouter, createWebHashHistory, createWebHistory, RouterView} from "vue-router";
import login from '@/views/login.vue'
import home from '@/views/home.vue'
import menu from '@/views/system/menu/menu.vue'
import layout from '@/components/layout/layout.vue'
import appMenu from "@/components/layout/menu.vue";
export const routerMap = [
    {
        path: '/login',
        name: '登录',
        meta: {title: '登录', noCache: true},
        component: login,
        hidden: true
    },
    {
        path: '/dashboard',
        component: appMenu,
        children: [
            {
                path: '/',
                component: RouterView,
                name: 'Dashboard',
                meta: {title: '首页', icon: 'index', affix: true, noCache: true}
            },
            {
                path: '/system',
                name: '写死（系统管理）',
                component: RouterView,
                children: [
                    {
                        path: 'sys1',
                        name: 'sys1',
                        component: menu
                    }
                ]
            },
            {
                path: '/usr',
                name: '写死（用户管理）',
                component: RouterView,
                children: [
                    {
                        path: 'user1',
                        name: 'user1',
                        component: menu
                    }
                ]
            }
        ]
    }
]

const Router = createRouter({
    // history 配置允许我们在不同的历史模式中进行选择
    history: createWebHashHistory(),
    routes: routerMap
})
export default Router